Skip to content

test(phpstan): fix remaining level 3 typing issues in tests/#1015

Merged
JohnVillalovos merged 1 commit intodevelopfrom
jlvillal/phpstan_3
Feb 15, 2026
Merged

test(phpstan): fix remaining level 3 typing issues in tests/#1015
JohnVillalovos merged 1 commit intodevelopfrom
jlvillal/phpstan_3

Conversation

@JohnVillalovos
Copy link
Collaborator

Enable PHPStan level 3 checking of all of the tests/ directory.

Copilot AI review requested due to automatic review settings February 15, 2026 05:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables PHPStan level 3 analysis across the entire tests/ tree by tightening test double typings and adjusting fake-page return values to match declared contracts.

Changes:

  • Updates phpDoc types in multiple test fakes to satisfy PHPStan’s array/union expectations.
  • Adjusts various fake page getters to return non-null defaults aligned with interface phpDocs (e.g., '', 0, false, []).
  • Updates phpstan_next.neon to stop excluding tests/Presenters/ from analysis.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/fakes/FakeResourceService.php Broadens $_AllResources phpDoc to include an additional fake resource type.
tests/fakes/FakeReservationViewRepository.php Refines iteration storage typing for reservation lists.
tests/fakes/FakePaymentRepository.php Adjusts phpDocs for credit cost and gateway fields to satisfy PHPStan.
tests/fakes/FakeAttributeService.php Refines $_ByCategory phpDoc to represent category-to-attributes structure.
tests/Presenters/SearchAvailabilityPresenterTest.php Casts repeat interval getter to `string
tests/Presenters/Search/SearchReservationsPresenterTest.php Returns empty strings instead of null for requested date getters.
tests/Presenters/SchedulePresenterTest.php Updates fake page getters to return typed defaults instead of null.
tests/Presenters/ResourceDisplayPresenterTest.php Updates fake getters to typed defaults ('', false).
tests/Presenters/Reservation/ReservationWaitlistPresenterTest.php Updates fake getters to typed defaults ([], '').
tests/Presenters/Reservation/ReservationMovePresenterTest.php Updates retry-parameter getter to [].
tests/Presenters/Reservation/ReservationInitializationTest.php Narrows initializer property phpDoc to concrete type.
tests/Presenters/Reservation/ReservationAttributesPresenterTest.php Updates fake page phpDocs and return values for PHPStan.
tests/Presenters/Reservation/GuestReservationPresenterTest.php Replaces null date returns with Date::Now() and boolean default.
tests/Presenters/Reports/SavedReportsPresenterTest.php Aligns bound definition phpDoc to interface type.
tests/Presenters/Reports/GenerateReportPresenterTest.php Normalizes several “IDs” getters to always return arrays; widens usage type.
tests/Presenters/RegisterPresenterTest.php Removes teardown nulling of properties.
tests/Presenters/LoginPresenterTest.php Introduces local variable for page arg; updates captcha getter default.
tests/Presenters/EmbeddedCalendarPresenterTest.php Updates title format getter to return ''.
tests/Presenters/CalendarSubscriptionPresenterTest.php Updates accessory IDs getter to return 0.
tests/Presenters/Admin/ManageUsersPresenterTest.php Implements GetImportFile() to return an UploadedFile test instance; typed defaults elsewhere.
tests/Presenters/Admin/ManagePaymentsPresenterTest.php Adds explicit phpDoc cast for PayPal fake gateway variable.
tests/Presenters/Admin/ManageConfigurationPresenterTest.php Updates getters to typed defaults ('', 0).
phpstan_next.neon Removes tests/Presenters/ from excludePaths to include it in analysis.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Enable PHPStan level 3 checking of all of the `tests/` directory.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@JohnVillalovos JohnVillalovos merged commit c1dd848 into develop Feb 15, 2026
17 checks passed
@JohnVillalovos JohnVillalovos deleted the jlvillal/phpstan_3 branch February 15, 2026 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant